<template>
  <div class="ListLeft">
    <div class="row" :class="item.id==isId ? 'active' : ''"   @click="clickrow(item.id)" v-for="item in listLeftArr" :key="item.id">
      {{item.classname}}
    </div>
  </div>
</template>

<script>
import { getNavFun } from '@/network/innerAxios'
export default {
  data () {
    return {
      listLeftArr: [],
      // 全部:id为47,企业站id:4.....
      isId: 47
    }
  },
  mounted () {
    this.getListLeft()
  },
  methods: {
    getListLeft () {
      getNavFun().then(res => {
        console.log(res.data)
        this.listLeftArr = res.data
      })
    },
    // 点击菜单进行高亮显示
    // clickrow(res){
    //   this.isId=res
    //   this.$emit("itemid" ,res)
    // }
    clickrow (res) {
      // console.log(res)
      this.isId = res
      this.$emit('itemid', res)
    }
  }
}
</script>

<style lang="less" scoped>
.ListLeft{
  background-color:#f8f8f8;
  height: 100%;
  .row{
    text-align: center;
    line-height:1rem;
    font-size: 0.32rem;
    border-bottom: .01rem solid #e8e8e8;
    color: #333;
    &.active{
      background-color: #fff;
      color: #31c27c;
    }
  }
}
</style>
